package com.speedricemanager.activity.home.registermodepart.mode;

import com.jbm.core.iface.IAcross;
import com.jbm.jsm.iface.TaskMouldRequireEntity;
import com.speedricemanager.activity.home.abstracts.NetModea;
import com.speedricemanager.activity.home.intface.IntegerFaceOr;
import com.speedricemanager.net.AllNet;

import java.util.Date;
import java.util.List;

/**
 * Created by 李征 on 2017/12/18.
 */

public class RegisterModePartMode extends NetModea implements RegisterModePartMode_Inter {
    private AllNet allNet;
    private IntegerFaceOr s;
    public RegisterModePartMode() {
        allNet=new AllNet(this);
    }

    @Override
    public void getMoluldInfo(int tm_Id, IntegerFaceOr integerFaceOr) {
        this.s=integerFaceOr;
        allNet.getMoluldInfo(tm_Id);

    }

    @Override
    public void AuditTaskMoulds(int tm_id, int status, String reason, String userpay, String requirement, String doFlow, String comment, Date startdate, Date enddate, String rental, String viceAccount, String mainDeposit, String viceDeposit, List<TaskMouldRequireEntity> requireList, IntegerFaceOr integerFaceOr) {
        this.s=integerFaceOr;
        allNet.AuditTaskMoulds(tm_id,status,reason,userpay,requirement,doFlow,comment,startdate,enddate,rental,viceAccount,mainDeposit,viceDeposit,requireList);

    }

    @Override
    public void getMeTeamEditidMasage(String userid, IntegerFaceOr integerFaceOr) {
        this.s=integerFaceOr;
        allNet.getUserInfo(userid);
    }

    @Override
    public void overMould(int tm_Id, IntegerFaceOr integerFaceOr) {
        this.s=integerFaceOr;
allNet.overMould(tm_Id);
    }

    @Override
    protected void onExe(IAcross iAcross, String methodName) {
        super.onExe(iAcross, methodName);
        if (methodName.equals("getMoluldInfo")){
          s.getError(iAcross);
        }else  if (methodName.equals("AuditTaskMould")){
            s.getError(iAcross);
        }else if (methodName.equals("getUserInfo")){
            s.getError(iAcross);
        }else if (methodName.equals("overMould")){
            s.getError(iAcross);
        }

    }

    @Override
    protected void onComplete(IAcross iAcross, String methodName) {
        super.onComplete(iAcross, methodName);
        if (methodName.equals("getMoluldInfo")){
            s.getSucces(iAcross);
        }else  if (methodName.equals("AuditTaskMould")){
            s.getSucces(iAcross);
        }else if (methodName.equals("getUserInfo")){
            s.getSucces(iAcross);
        }else if (methodName.equals("overMould")){
            s.getSucces(iAcross);
        }
    }
}
